import http from "@/api";

/**
 * @name 门禁点管理模块
 */
// 获取门禁点列表
export const getDoorList = (params = {}) => {
  return http.post(`/door/query`, params, { noLoading: true });
};

// 新增门禁点
export const addDoor = (params = {}) => {
  return http.post(`/map/door/add`, params);
};

// 删除门禁点
export const deleteDoor = (params: { roomId: string }) => {
  return http.post(`/map/door/delete`, params);
};

// 切换是否启用
export const changeEnabled = (params = {}) => {
  return http.post(`/door/enabled`, params);
};

// 酒店选择列表
export const getAreaSelList = (params = {}) => {
  return http.get(`/lookup/areas`, params, { noLoading: true });
};

/**
 * 增加用户锁地图树节点
 * @param params
 */
export const addMapNode = (params = {}) => {
  return http.post(`/map/save`, params, { noLoading: true });
};

/**
 * 修改用户锁地图树节点
 * @param params
 */
export const editMapNode = (params = {}) => {
  return http.post(`/map/save`, params, { noLoading: true });
};

/**
 * 删除用户锁地图树节点
 * @param params
 */
export const delMapNode = (params = {}) => {
  return http.post(`/map/delete`, params, { noLoading: true });
};

/**
 * 上传锁地图节点照片
 * @param params
 */
export const uploadPhoto = (params = {}) => {
  return http.post(`/map/photo/upload`, params, {
    noLoading: true,
    headers: {
      "Content-Type": "multipart/form-data"
    }
  });
};
